package com.zhouyu.jpademo.config;

import java.io.Serializable;
import org.hibernate.HibernateException;
import org.hibernate.engine.spi.SharedSessionContractImplementor;
import org.hibernate.id.UUIDGenerator;

/**
 * @author 周宇
 * @version 1.0 date: 2019/7/22 14:24
 * @description:String的继承UUIDGenerator，Long类型继承IdentityGenerator
 * @Copyright (C), 2017-2019, 深圳市⾦证引擎科技股份有限公司
 */
public class SnowFlakeGenerator extends UUIDGenerator {

  @Override
  public Serializable generate(SharedSessionContractImplementor session, Object object)
      throws HibernateException {
    //TODO 自定义雪花ID
    return "id";
  }
}
